/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package phamquochuong_cn6;

import java.util.Scanner;

/**
 *
 * @author Admin_Pro
 */
public class Bai5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n;
        System.out.println("nhap so fibonaxi can tim: ");
        n = sc.nextLong();
        double m = Math.sqrt(5),m1,m2;
        m1 = Math.pow((1+m)/2,n);
        m2 = Math.pow((1-m)/2,n);
        m = (m1-m2)/m;
        System.out.println("so fibonaxi can tim la: " + (long) m);
    }
}
